/* ==========================================================================
   "Download app" (application/views/enduser/theme_includes/pwa_install.php,
   themes/shared/js/pwa-install.js).
   - The call to action: its own row in the page's footer, after the menu
     columns - the words, then a button in the portal's brand colour (the
     script paints it, with dark or white text, whichever reads).
   - A link to #download-app the page already has (Navigations) gets the
     app's icon and the same button look.
   - A page with no footer: the small fallback button under it.
   - The note with the steps (iPhone, Safari on a Mac).
   Every rule is scoped to these classes: no theme's styles reach them, and
   they reach none.
   ========================================================================== */
.qme-pwa[hidden],
.qme-pwa [hidden],
.qme-pwa-help[hidden],
.qme-pwa-row[hidden],
a[href$="#download-app"][hidden],
li[hidden] > a[href$="#download-app"] { display: none !important; }

/* the row: words left, button right; the button drops under the words on a phone */
.qme-pwa-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    clear: both;
    box-sizing: border-box;
    width: 100%;
    margin: 24px 0 12px;
    padding: 16px 20px;
    border: 1px solid rgba(127, 127, 127, .28);
    border-radius: 14px;
    background: rgba(127, 127, 127, .08);
    color: inherit;
    text-align: left;
    font-size: 15px;
    line-height: 1.4;
}
.qme-pwa-row .qme-pwa-row__text {
    flex: 1 1 260px;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: inherit;
    font-size: 15px;
}
.qme-pwa-row .qme-pwa-row__text strong {
    display: block;
    margin: 0 0 2px;
    color: inherit;
    font-size: 17px;
    font-weight: 700;
}
.qme-pwa-row .qme-pwa-row__text span {
    display: block;
    color: inherit;
    opacity: .8;
    font-size: 14px;
}

/* the button (the row's, and a #download-app link from Navigations) */
a.qme-pwa-cta,
a.qme-pwa-link[href$="#download-app"] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 0;
    box-sizing: border-box;
    width: auto !important;
    margin: 0 !important;
    padding: 11px 22px 11px 14px !important;
    border: 1.5px solid currentColor;
    border-radius: 999px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
a.qme-pwa-cta:hover,
a.qme-pwa-link[href$="#download-app"]:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .24); }
a.qme-pwa-cta:focus-visible,
a.qme-pwa-link[href$="#download-app"]:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
a.qme-pwa-cta::before, a.qme-pwa-cta::after,
a.qme-pwa-link[href$="#download-app"]::before,
a.qme-pwa-link[href$="#download-app"]::after { content: none !important; }
@media (prefers-reduced-motion: reduce) {
    a.qme-pwa-cta, a.qme-pwa-link[href$="#download-app"] { transition: none; }
    a.qme-pwa-cta:hover, a.qme-pwa-link[href$="#download-app"]:hover { transform: none; }
}

/* the app's icon in the button */
a[href$="#download-app"] .qme-pwa-link-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin: 0 10px 0 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    object-fit: contain;
    max-width: none;
    box-shadow: none;
    background: #fff;
}

@media (max-width: 600px) {
    .qme-pwa-row { padding: 14px 16px; }
    .qme-pwa-row a.qme-pwa-cta { flex: 1 1 100%; margin-right: 76px !important; }
}

/* the fallback: one small button under the page, never floating */
.qme-pwa {
    display: block;
    clear: both;
    margin: 0;
    padding: 14px 16px 18px;
    background: transparent;
    text-align: center;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}
.qme-pwa .qme-pwa__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 7px 14px 7px 8px;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.qme-pwa .qme-pwa__btn:hover { border-color: var(--site_color_g, #1f2937); }
.qme-pwa .qme-pwa__btn:focus-visible { outline: 2px solid var(--site_color_g, #1f2937); outline-offset: 2px; }
.qme-pwa .qme-pwa__icon {
    width: 24px;
    height: 24px;
    margin: 0;
    border-radius: 6px;
    object-fit: contain;
}

/* the steps for a browser with no install dialog (iPhone, Safari on a Mac): a note at the bottom
   of the screen, closed by a tap or after 12 seconds */
.qme-pwa-help {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 2147482000;
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 420px;
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: #1f2937;
    color: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    cursor: pointer;
}
